#ifndef CHECKOUTDIALOG_H
#define CHECKOUTDIALOG_H

#include <ProcInfoUtils.h>
#include <QDialog>
#include <QProcess>
#include <QTimer>

namespace Ui {
class CheckoutDialog;
}

class CheckoutDialog : public QDialog
{
    Q_OBJECT

public:
    enum Type {
        Simple,
        Multiple,
        Sync,
        SyncDetach
    };
    explicit CheckoutDialog(QWidget *parent = nullptr);
    ~CheckoutDialog();

    void setWorkdir(const QString &newWorkdir);

    // simple or multiple
    void setPath(const QString &newPath);
    void setPaths(const QStringList &newPaths);

    void start();

    void setType(Type newType);

signals:
    void checkouted();

private:
    Ui::CheckoutDialog *ui;

    ProcInfoUtils m_procinfo;
    QTimer m_procinfo_timer;

    QProcess m_process;
    QString m_workdir;

    Type m_type;
    QString m_path;
    QStringList m_paths;
};

#endif // CHECKOUTDIALOG_H
